<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateTask extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('task', function (Blueprint $table) {
            $table->id();
            $table->integer('type')->default(0)->comment('任务类型');
            $table->string('hash', 200)->comment('唯一标识');
            $table->text('data')->nullable()->comment('业务数据');
            $table->text('response')->nullable()->comment('响应');
            $table->integer('is_finish')->default(0)->comment('是否完成');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('task');
    }
}
